package com.caldremch.androidfoundation.activity.login;

import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.caldremch.androidfoundation.R;
import com.caldremch.androidfoundation.base.BasePresenterActivity;

import butterknife.BindView;

/**
 *
 * @author Caldremch
 * @date 2018/11/6
 * @Email caldremch@163.com
 * @describe login
 *
 **/
public class LoginActivity extends BasePresenterActivity<LoginPresenter> implements LoginContact.View {

    @BindView(R.id.et_username)
    EditText mUsername;


    @BindView(R.id.et_password)
    EditText mPassword;

    @BindView(R.id.btn_login)
    Button mBtnLogin;

    @Override
    public void onLoginSucc() {
        Log.d("caldremch", "登陆成功回调 = ");
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    protected void initView() {
        mBtnLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


                String username = mUsername.getText().toString();
                String password = mPassword.getText().toString();

                mPresenter.login(username, password);



            }
        });
    }

    @Override
    protected void initData() {

        Log.d("caldremch", "mPresenter = " + mPresenter);

    }
}
